Phone Object SQL COM Example
============================

*DISCLAIMER*
==========================================================================
We do not support 32-bit versions of SQL Server due to memory constraints
==========================================================================

The first SQL script (CreateList.SQL) will create a table and insert 13 sample records from Nevada into this newly created table.  This gives the user example phone numbers to process, and fields to populate with the returned results - without having to modify our code just to see the procedure run.

The second file, PhoneObject.SQL, creates a stored procedure that will phone check the list created by the first script.



In general, to use the SQL demo, here's what you need to do:

1. Install the Phone Object on the machine running SQL server, not the local workstation. The stored procedure runs on the server, so the Phone Object has to be where the stored procedure will run. Running the installation program will automatically register the COM object.

2. Start up SQL Query Analzyer. We recommend you change over to a database other than Master.  Northwind is a common database to use, but you can select any database.

3. Open up the file CreateList.SQL and execute the script.

4. Open up the file PhoneObject.SQL

5. Change the path in the line of code listed below to where you installed the mdAddr.dat and zipnpa.txt files:
	SET  @DataPath = 'C:\Program Files\Melissa Data\COM Objects\Data Files\'	

6. If you have a license string, replace the following line's string with the actual license string provided to you.
	SET  @License = 'Enter License String Here'
Alternatively, you can set the license as an Environmental Variable, enabling you to change the license without changing your code or stopping the service. See the Documentation for instructions on setting the environmental variable.
 
7. Execute PhoneObject.SQL
	
8. Run the stored procedure with the command exec sp_PhoneCheck.

9. The records in the PhoneList Table (Select * from PhoneList) will be updated.  When the table is newly created, the phone numbers are not parsed or corrected and now most records will be coded.  We do not code all records in the table, as we wanted to demo error codes that would be returned as well.
